package com.awardsystem.Utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class ColumnTitleMap {
    private Map<String, String> columnTitleMap = new HashMap<String, String>();
    private ArrayList<String> titleKeyList = new ArrayList<String> ();

    public ColumnTitleMap(String type) {
        switch (type) {
            case "sci":
                initSCIColu();
                initSCITitleKeyList();
                break;
            case "patent":
                initPatentColu();
                initPatentTitleKeyList();
                break;
            default:
                break;
        }

    }
    /**
     * mysql表需要导出字段--显示名称对应集合
     */
    private void initSCIColu() {
        columnTitleMap.put("sci_id","id");
        columnTitleMap.put("create_time", "接收日期");
        columnTitleMap.put("update_time", "刊发日期");
        columnTitleMap.put("name", "标题");
        columnTitleMap.put("url", "链接");
        columnTitleMap.put("correspond_user","通讯作者");
        columnTitleMap.put("first_author","第一作者");
        columnTitleMap.put("achievements","成就列表");
        columnTitleMap.put("projects","项目列表");
    }

    /**
     * mysql表需要导出字段集
     */
    private void initSCITitleKeyList() {
        titleKeyList.add("sci_id");
        titleKeyList.add("number");
        titleKeyList.add("create_time");
        titleKeyList.add("update_time");
        titleKeyList.add("name");
        titleKeyList.add("url");
        titleKeyList.add("correspond_user");
        titleKeyList.add("first_author");
        titleKeyList.add("achievements");
        titleKeyList.add("projects");
    }

    /**
     * mysql表需要导出字段--显示名称对应集合
     */
    private void initPatentColu() {
        columnTitleMap.put("patent_id","id");
        columnTitleMap.put("name", "标题");
        columnTitleMap.put("type", "类型");
        columnTitleMap.put("apply_date", "申报日期");
        columnTitleMap.put("auth_date", "授权日期");
        columnTitleMap.put("url", "链接");
        columnTitleMap.put("authors","作者（按照作者顺序排序）");
        columnTitleMap.put("achievements","成就列表");
        columnTitleMap.put("projects","项目列表");
    }

    /**
     * mysql表需要导出字段集
     */
    private void initPatentTitleKeyList() {
        titleKeyList.add("patent_id");
        titleKeyList.add("name");
        titleKeyList.add("type");
        titleKeyList.add("apply_date");
        titleKeyList.add("auth_date");
        titleKeyList.add("url");
        titleKeyList.add("authors");
        titleKeyList.add("achievements");
        titleKeyList.add("projects");
    }
    public Map<String, String> getColumnTitleMap() {
        return columnTitleMap;
    }

    public ArrayList<String> getTitleKeyList() {
        return titleKeyList;
    }

}
